<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd">
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="x-ua-compatible" content="IE=edge, chrome=1">
    <title>j5shop商城</title>
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <link href="/street/css/public.css" type="text/css" rel="stylesheet"/>
    <link href="/street/css/lanmu.css" type="text/css" rel="stylesheet"/>
    <script type="text/javascript" src="/street/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="/street/js/slide.js"></script>
</head>
<body>
<script>
    $(function(){
        $('.nav ul li').hover(function(){
            $(this).children(".details").show();
        },function(){
            $(this).children(".details").hide();
        });
        $('#my').hover(function(){
            $(this).find("div").show();
        },function(){
            $(this).find("div").hide();
        });
    });
</script>

<div th:replace="street/layout/mallHeader"></div>
<!----------------轮播图-------------------->
<div class="index_banner minWidth" id="focus">
    <ul>
        <li th:each="banner:${bannerList}" th:style="'background:url(' + ${banner.img} + ') no-repeat center;height: 452px;'">
            <a th:href="${banner.url}" title="" target="_blank"></a></li>
    </ul>
</div>
<div class="clear"></div>
<!--------------中间部分-------------><!--------------中间部分------------->
<div class="content">
    <!-------------新品推荐------------->
    <div class="wt1080 tuijian">
        <div class="wenzi">
            <div class="a_wenzi">新品推荐</div>
            <div class="heng"></div>
        </div>
        <div class="shangping">
            <ul>
                <li th:each="goods:${xinpinList}" th:if="${xinpinList}">
                    <div class="fl pic"><a th:href="@{'/street/goodsDetail/'+${goods.id}}">
                        <img th:src="@{${goods.img}}" width="135px" height="160px"></a></div>
                    <div class="fl dd">
                        <h1><a th:href="@{'/street/goodsDetail/'+${goods.id}}" th:text="${goods.title}">三洋一次性防溢乳垫</a></h1>
                        <p class="one">柔软高吸收<br/>立体弧形贴合乳房</p>
                        <p class="two"><span>￥<span style="font-size: 22px;" th:text="'￥'+${goods.prices}">89.00</span></span><font th:text="'￥'+${goods.prices}">￥128.00</font></p>
                        <p class="three">新品上线</p>
                    </div>
                </li>


            </ul>
            <span class="heng1"></span>
            <span class="shu1"></span>
            <span class="shu2"></span>
        </div>
        <!---------------商品列表---------------->
        <div class="ware wt1080" th:each="type:${goodsTypeList}" th:if="${goodsTypeList}">
            <div class="ware_top">
                <span th:text="${type.name}">面霜乳液</span>
                <a th:href="@{'/street/goodsByType/'+${type.id}}">更多&gt;&gt;</a>
            </div>
            <div class="ware_bottom">
                <ul>
                    <li th:each="goods:${type.goods_list}" th:if="${type.goods_list}">
                        <div class="pic"><a th:href="@{'/street/goodsDetail/'+${goods.id}}">
                            <img th:src="@{${goods.img}}" width="233px" height="213px"></a></div>
                        <p style="margin-bottom: 10px;"><a th:href="@{'/street/goodsDetail/'+${goods.id}}" th:text="${goods.title}">原</a></p>
                        <p><span class="one"><span style="font-size: 22px;" th:text="'￥'+${goods .prices}">336.00</span></span><span class="two" th:text="'￥'+${goods .prices}">￥336.00</span></p>
                        <div class="qianggou"><a href="#" th:onclick="'addCart('+${goods.id}+')'">立即抢购</a></div>
                    </li>

                </ul>
                <div class="clear"></div>
            </div>
        </div>

    </div>
</div>



<div th:replace="street/layout/mallFooter"></div>
<script type="application/javascript">
    function addCart(goodsid){
        console.log(goodsid);
        var count=1;
        $.ajax({
            type: "post",
            url: '/person/street/addCart',
            data: {
                goodsid:goodsid,
                count:count},
            dataType: "json",
            success:function(data) {
                if(data.code==0){
                    window.location.href = "/person/street/likBuy/"+goodsid;
                }else if(data.success=='login'){
                    window.location.href = "/street/login"
                }
            }
        });
    }
</script>
</body>
</html>